package com.ac.app.dao.hibernate;

import java.sql.Statement;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.hibernate.Session;
import org.hibernate.Transaction;
import org.springframework.orm.hibernate3.support.HibernateDaoSupport;

import com.ac.app.dao.PickDao;

/**
 * <p>Title: </p>
 * <p>Description: </p>
 * <p>Copyright: Copyright caac 2006</p>
 * <p>Company: caac</p>
 * @author <a href="mailto:project@caac.com.cn">Project Group</a>
 * @version 1.0
 */

public class PickDaoHibernate extends HibernateDaoSupport implements PickDao {
    protected final Log log = LogFactory.getLog(getClass());

    public void insertPkRcdAndPkUrl(String rcdSql,String UrlSql)
    {
    	Session ses = null;
	    Statement stmt = null;
	    try {
	        ses = getSessionFactory().openSession();
	        Transaction tx = ses.beginTransaction();
	        stmt = ses.connection().createStatement();
	        stmt.execute(rcdSql);
	        stmt.execute(UrlSql);
	        tx.commit();
	    } catch (Exception e) {
	        e.printStackTrace();
	    } finally {
	        try {
	            if (stmt != null) {
	                stmt.close();
	            }
	            if (ses != null) {
	                ses.close();
	            }
	        } catch (Exception e) {}
	    }
	}
}
